package com.controller;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/fPro")
public class FProducerController {
    @Resource
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("/send")
    public String send(@RequestParam("message") String message){
        rabbitTemplate.convertAndSend("fanout_exchange","",message);
        return "fanout交换机11";
    }
}
